
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.List" %> 
<%@ page import="xujiwen.transport.bean.PassRecord" %>
<%@ page import="xujiwen.transport.Mgr.PassRecordMgr" %>
<%@ page import="xujiwen.transport.bean.User" %>
<%@ page import="xujiwen.transport.Mgr.UserMgr" %>
<%@ page import="java.util.Calendar" %>
<%@ page import="java.util.Date" %>
<%

User user = (User)session.getAttribute("user");
if(user == null)
{
	response.getWriter().println("请登录！");
	return ;
}
String searchStr = request.getParameter("searchStr");
String keyword=new String(searchStr.getBytes("ISO-8859-1"),"utf-8");
///
//System.out.println(keyword);
PassRecordMgr pm = new PassRecordMgr();

List<PassRecord> passList = pm.GetSearchPassList(keyword);

%>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">

<style>
html,body{height:100%;overflow:hidden;}
body,div,h2{margin:0;padding:0;}
body{font:12px/1.5 Tahoma;}
center{padding-top:10px;}
button{cursor:pointer;}
#overlay{position:absolute;top:0;left:0;width:100%;height:100%;background:#000;opacity:0.5;filter:alpha(opacity=50);display:none;}
#win{position:absolute;top:25%;left:50%;width:400px;height:400px;background:#fff;border:4px solid #f90;margin:-102px 0 0 -202px;display:none;}
.title{font-size:12px;text-align:right;background:#FC0;border-bottom:3px solid #f90;padding:5px;height:20px}
.title_left {float:left;}
.title_right {float:right;}
.title_right span{color:#f90;cursor:pointer;background:#fff;border:1px solid #f90;padding:0 2px;}
.content{padding:5px;}
</style>

<script LANGUAGE="javascript">
　　<!--
	var array = new Array();	// 
	var oWin;
	var oLay;
	
　　function openwin() {
		oWin = document.getElementById("win");
		oLay = document.getElementById("overlay");
	    var oClose = document.getElementById("close");
	 
	    oClose.onclick = function ()
	    {
	        oLay.style.display = "none";
	        oWin.style.display = "none"
	    }
　　}
	
	function openFrom(){
		
		//field.value = array[index][0];		
		// 其他字段,在input中得到name
		
		oLay.style.display = "block";
	    oWin.style.display = "block"
	    
	     
	}
	// 提交时
	function dosubmit(){
	alert('确定');
		// 检测
		return true;
	}
	
　　//-->
</script>

<title>进站记录查询管理</title>
</head>
<body onLoad="openwin()">
<div align="left"><form action="entryRecord.jsp">
	<label>搜索: </label><input type="text" name="searchStr">
	<input type="submit" value="搜索" />
</form>
</div>
<div>
<button onClick="openFrom()">添加出站记录</button>
</div>
<div>
<table width="800" border='1'>
<tr>
	<td>IC卡号</td>
	<td>车牌号</td>
	<td>收费金额</td>
	<td>入口站点</td>
	<td>进站时间</td>
	<td>出口站点</td>
	<td>出站时间</td>
	<td>删除</td>
	</tr>
<%for (int i=0;i<passList.size();i++){
	PassRecord passRecord = passList.get(i);
	
	//java.text.SimpleDateFormat format = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

	//String entryTime = format.format(enterRecord.getEnterDate());

	%>

	<tr bgcolor="<%=i%2==0?"#a7bb88":"" %>">
	
	<td><%=passRecord.getIcid() %></td>
	<td><%=passRecord.getCid() %></td>
	<td><%=passRecord.getDealSum() %></td>
	<td><%=passRecord.getEntryName() %></td>
	<td><%=passRecord.getEntryDate() %></td>
	<td><%=passRecord.getExitName() %></td>
	<td><%=passRecord.getExitDate() %></td>
	<td><form action="../delpass" method="post" onSubmit="return dosubmit();">
	<input type="hidden" name="delid" value="<%=passRecord.getPid() %>">
	<input type="submit" value="删除" />
	</form></td>
	</tr>

<%}%>
</table>
</div>

<div id="overlay"></div>
 
<div id="win">
    <div class="title">
        <div class="title_left">添加记录</div>
        <div class="title_right"><span id="close">x</span></div>        
    </div>
    <div class="content">
    <form name="tfrom" action="../addpass" method="post" onSubmit="return dosubmit();">
    <table border=0>
    <tr>
     	<td><label>IC卡号</label></td>
     	<td>
     	<input type="text" value="" id="icid" name="icid">
	</td>
    </tr>
	<tr>
		<td align="right"><input type="submit" value="添加记录" /></td>
	</tr>
	</table></form></div>
</div>

</body>
</html>